package descentFly.away3D4.element
{
	import away3d.loaders.Loader3D;
	
	import descentFly.away3D4.df_awaySpace;
	import descentFly.away3D4.df_loadSection;
	
	import flash.geom.Matrix3D;
	
	public class df_element3DS extends df_element {
		private var _loadModel: Loader3D;
		public function df_element3DS(mat: Matrix3D, a_space:df_awaySpace, a_options:Object) {
			super(mat, a_space, a_options);
		}
		
		override protected function modelInit(mat: Matrix3D):void {
			super.modelInit(mat);
			var ls: df_loadSection = new df_loadSection();
			_loadModel = ls.addLoader3D(options.URL);
			_loadModel.transform = mat;
			ls.endSection(function(): void {
				if (_loadModel) model = _loadModel;
			});
		}
		
		override public function dispose():void {
			_loadModel = null;
			super.dispose();
		}
	}
}